<?php


namespace app\common\model;


use think\Model;

class AdsModel extends Model
{
    protected $name = 'ads';

    public function getList(int $position_id)
    {
        return $this
            ->field(['id','position_id','image','image_wap'])
            ->where([
                'position_id' => $position_id,
                'status' => 1
            ])
            ->order([
                'weigh' => 'asc',
            ])
            ->select();
    }

    public function getAds(int $position_id)
    {
        return $this
            ->field(['id','position_id','image','image_wap'])
            ->where([
                'position_id' => $position_id,
                'status' => 1
            ])
            ->find();
    }

}